/*
 * DoctypeElement.h
 *
 *  Created on: 2010-6-5
 *      Author: Guobc
 */

#ifndef DOCTYPEELEMENT_H_
#define DOCTYPEELEMENT_H_

#include "CommonElement.h"

namespace HA {
class DoctypeElement: public HA::CommonElement {
public:
	DoctypeElement();

	/**
	 * Sets string contents of the node
	 * @param text The new text for the node
	 */
	inline void setText(string& text) {
		mText = text;
	}

	/**
	 * Get the set of names handles by this element.
	 * @return The names to be matched that create elements of this type.
	 */
	inline string* getIds() const {
		return mIds;
	}

	/**
	 * Allow creating an instance of this node.
	 * @return A new instance of this node.
	 */
	inline ASTNode* newInstance() const {
		return new DoctypeElement();
	}

	/**
	 * Return the HTML for this node.
	 * This should be the sequence of characters that were encountered by
	 * the parser that caused this node to be created. Where this breaks down is
	 * where broken nodes (tags and remarks) have been encountered and fixed.
	 * Applications reproducing html can use this method on nodes which are to
	 * be used or transferred as they were received or created.
	 * @return The sequence of characters that would cause this node
	 * to be returned by the parser or lexer.
	 */
	inline string toHTML() {
		return "<!DOCTYPE " + mText + ">";
	}

private:
	static string mIds[];
	string mText;
};
}

#endif /* DOCTYPEELEMENT_H_ */
